home *** CD-ROM | disk | FTP | other *** search
/ Mac Easy 2010 May / Mac Life Ubuntu.iso / casper / filesystem.squashfs / bin / hw-detect < prev    next >
Encoding:
Text File  |  2009-04-19  |  16.0 KB  |  642 lines

  1. #!/bin/sh
  2.  
  3. set -e
  4. . /usr/share/debconf/confmodule
  5. #set -x
  6.  
  7. if [ -z "$1" ]; then
  8.     PROGRESSBAR=hw-detect/detect_progress_step
  9. else
  10.     PROGRESSBAR=$1
  11. fi
  12.  
  13. NEWLINE="
  14. "
  15. MISSING_MODULES_LIST=""
  16. SUBARCH="$(archdetect)"
  17.  
  18. finish_install=/usr/lib/finish-install.d/30hw-detect
  19.  
  20. LOAD_IDE=""
  21. if db_get hw-detect/load-ide && [ "$RET" = true ]; then
  22.     LOAD_IDE=1
  23. fi
  24.  
  25. # Check for virtio devices
  26. if [ -d /sys/bus/pci/devices ] && \
  27.     grep -q 0x1af4 /sys/bus/pci/devices/*/vendor 2>/dev/null && \
  28.     ! grep -q ^virtio_ /proc/modules; then
  29.     anna-install virtio-modules || true
  30. fi
  31.  
  32. if [ -x /sbin/depmod ]; then
  33.     depmod -a > /dev/null 2>&1 || true
  34. fi
  35.  
  36. log () {
  37.     logger -t hw-detect "$@"
  38. }
  39.  
  40. is_not_loaded() {
  41.     ! ((cut -d" " -f1 /proc/modules | grep -q "^$1\$") || \
  42.        (cut -d" " -f1 /proc/modules | sed -e 's/_/-/g' | grep -q "^$1\$"))
  43. }
  44.  
  45. is_available () {
  46.     [ "$(modprobe -l $1)" ] || return 1
  47. }
  48.  
  49. # Module as first parameter, description of device the second.
  50. missing_module () {
  51.     if ! in_list "$1" "$MISSING_MODULES_LIST"; then
  52.         if [ -n "$MISSING_MODULES_LIST" ]; then
  53.             MISSING_MODULES_LIST="$MISSING_MODULES_LIST, "
  54.         fi
  55.         MISSING_MODULES_LIST="$MISSING_MODULES_LIST$1 ($2)"
  56.     fi
  57. }
  58.  
  59. # The list can be delimited with spaces or spaces and commas.
  60. in_list() {
  61.     echo "$2" | grep -q "\(^\| \)$1\(,\| \|$\)"
  62. }
  63.  
  64. snapshot_devs() {
  65.     echo -n `grep : /proc/net/dev | cut -d':' -f1`
  66. }
  67.  
  68. compare_devs() {
  69.     local olddevs="$1"
  70.     local devs="$2"
  71.     local dev newdevs
  72.  
  73.     newdevs=
  74.     for dev in $devs; do
  75.         if ! echo " $olddevs " | grep -q " $dev "; then
  76.             newdevs="${newdevs:+$newdevs }$dev"
  77.         fi
  78.     done
  79.     echo "$newdevs"
  80. }
  81.  
  82. load_module() {
  83.     local module="$1"
  84.     local cardname="$2"
  85.     local devs=""
  86.     local olddevs=""
  87.     local newdev=""
  88.  
  89.     old=`cat /proc/sys/kernel/printk`
  90.     echo 0 > /proc/sys/kernel/printk
  91.  
  92.     devs="$(snapshot_devs)"
  93.     if log-output -t hw-detect modprobe -v "$module"; then
  94.         olddevs="$devs"
  95.         devs="$(snapshot_devs)"
  96.         newdevs="$(compare_devs "$olddevs" "$devs")"
  97.  
  98.         # Make sure space is used as a delimiter.
  99.         IFS_SAVE="$IFS"
  100.         IFS=" "
  101.         if [ -n "$newdevs" -a -n "$cardname" ]; then
  102.             mkdir -p /etc/network
  103.             for dev in $newdevs; do
  104.                 echo "${dev}:${cardname}" >> /etc/network/devnames
  105.             done
  106.         fi
  107.         IFS="$IFS_SAVE"
  108.     else   
  109.         log "Error loading '$module'"
  110.         if [ "$module" != floppy ] && [ "$module" != ide-floppy ] && \
  111.            [ "$module" != ide-cd ]; then
  112.             db_subst hw-detect/modprobe_error CMD_LINE_PARAM "modprobe -v $module"
  113.             db_input medium hw-detect/modprobe_error || [ $? -eq 30 ]
  114.             db_go
  115.         fi
  116.     fi
  117.  
  118.     echo $old > /proc/sys/kernel/printk
  119. }
  120.  
  121. # Some pci chipsets are needed or there can be DMA or other problems.
  122. get_ide_chipset_info() {
  123.     for ide_module in $(find /lib/modules/*/kernel/drivers/ide/pci/ -type f 2>/dev/null); do
  124.         if [ -e $ide_module ]; then
  125.             baseidemod=$(echo $ide_module | sed 's/\.ko$//; s/.*\///')
  126.             echo "$baseidemod:IDE chipset support"
  127.         fi
  128.     done
  129. }
  130.  
  131. # Return list of lines formatted "module:Description"
  132. get_detected_hw_info() {
  133.     if [ "${SUBARCH%%/*}" = powerpc ]; then
  134.         discover-mac-io
  135.         if [ "$SUBARCH" = powerpc/chrp_rs6k ] || \
  136.            [ "$SUBARCH" = powerpc/chrp_ibm ]; then
  137.             discover-ibm
  138.         fi
  139.     fi
  140.     if [ "${SUBARCH%%/*}" = sparc ]; then
  141.         discover-sbus
  142.     fi
  143.     if [ -d /proc/bus/usb ]; then
  144.         echo "usb-storage:USB storage"
  145.     fi
  146. }
  147.  
  148. # NewWorld PowerMacs don't want floppy or ide-floppy, and on some models
  149. # (e.g. G5s) the kernel hangs when loading the module.
  150. get_floppy_info() {
  151.     case $SUBARCH in
  152.         powerpc/powermac_newworld) ;;
  153.         *) echo "floppy:Linux Floppy" ;;
  154.     esac
  155. }
  156.  
  157. get_ide_floppy_info() {
  158.     case $SUBARCH in
  159.         powerpc/powermac_newworld) ;;
  160.         *) echo "ide-floppy:Linux IDE floppy" ;;
  161.     esac
  162. }
  163.  
  164. get_rtc_info() {
  165.     # On i386, this gets loaded by hotplug through isapnp, but that
  166.     # doesn't work on amd64.
  167.     case $SUBARCH in
  168.         amd64/*) register-module rtc ;;
  169.     esac
  170. }
  171.  
  172. # Manually load modules to enable things we can't detect.
  173. # XXX: This isn't the best way to do this; we should autodetect.
  174. # The order of these modules are important.
  175. get_manual_hw_info() {
  176.     if [ "$LOAD_IDE" ]; then
  177.         get_floppy_info
  178.         get_ide_chipset_info
  179.         echo "ide-generic:Linux IDE support"
  180.         get_ide_floppy_info
  181.         echo "ide-disk:Linux ATA DISK"
  182.         echo "ide-cd:Linux ATAPI CD-ROM"
  183.     fi
  184.     get_rtc_info
  185.  
  186.     # on some hppa systems, nic and scsi won't be found because they're
  187.     # not on a bus that udev understands ... 
  188.     if [ "`udpkg --print-architecture`" = hppa ]; then
  189.         echo "lasi_82596:LASI Ethernet"
  190.         register-module lasi_82596
  191.         echo "lasi700:LASI SCSI"
  192.         register-module -i lasi700
  193.         echo "zalon7xx:Zalon SCSI"
  194.         register-module -i zalon7xx
  195.     fi
  196.  
  197.     case $SUBARCH in
  198.         powerpc/ps3)
  199.             echo "ps3rom:PS3 internal CD-ROM drive"
  200.             echo "ps3disk:PS3 internal disk drive"
  201.             echo "ps3_gelic:PS3 Gigabit Ethernet"
  202.             register-module snd_ps3
  203.         ;;
  204.     esac
  205. }
  206.  
  207. # Based on syslog from #486298
  208. megaraid_complete() {
  209.     dmesg | grep -Eq "megaraid mbox: (Wait for 0 commands to complete|reset sequence completed sucessfully)"
  210. }
  211. wait_megaraid_complete() {
  212.     local wait=300
  213.  
  214.     if megaraid_complete; then
  215.         return 0
  216.     fi
  217.  
  218.     sleep 10 # Early initialization phase
  219.     if dmesg | grep -q "megaraid mbox: Wait for [0-9]*[1-9] commands to complete"; then
  220.         log "Megaraid initialization: waiting for reset to complete"
  221.         while [ $wait -gt 0 ]; do
  222.             sleep 1
  223.             if megaraid_complete; then
  224.                 log "Megaraid initialization: reset complete"
  225.                 sleep 1
  226.                 break
  227.             fi
  228.             wait=$(($wait - 1))
  229.         done
  230.         if [ $wait -eq 0 ]; then
  231.             log "Megaraid initialization: failed to complete reset!"
  232.         fi
  233.     fi
  234. }
  235.  
  236. # Should be greater than the number of kernel modules we can reasonably
  237. # expect it will ever need to load.
  238. MAX_STEPS=1000
  239. OTHER_STEPS=5
  240. # Use 1/10th of the progress bar for the non-module-load steps.
  241. OTHER_STEPSIZE=$(expr $MAX_STEPS / 10 / $OTHER_STEPS)
  242. db_progress START 0 $MAX_STEPS $PROGRESSBAR
  243.  
  244. db_progress INFO hw-detect/detect_progress_step
  245.  
  246. # TODO: Can possibly be removed if udev will load yenta_socket automatically
  247. # Load yenta_socket, if hardware is available, for Cardbus cards.
  248. if [ -d /sys/bus/pci/devices ] && \
  249.     grep -q 0x060700 /sys/bus/pci/devices/*/class 2>/dev/null && \
  250.     ! grep -q ^yenta_socket /proc/modules; then
  251.     db_subst hw-detect/load_progress_step CARDNAME "Cardbus bridge"
  252.     db_subst hw-detect/load_progress_step MODULE "yenta_socket"
  253.     db_progress INFO hw-detect/load_progress_step
  254.     
  255.     log "Detected Cardbus bridge, loading yenta_socket"
  256.     load_module yenta_socket
  257.     # Ugly hack, but what's the alternative?
  258.     sleep 3 || true
  259. fi
  260.  
  261. # If using real hotplug, re-run the rc scripts to pick up new modules.
  262. # TODO: this just loads modules itself, rather than handing back a list
  263. # Since we've just run depmod, new modules might be available, so we
  264. # must trigger as well as settle.
  265. update-dev
  266.  
  267. ALL_HW_INFO=$(get_detected_hw_info; get_manual_hw_info)
  268. db_progress STEP $OTHER_STEPSIZE
  269.  
  270. # Remove modules that are already loaded or not available, and construct
  271. # the list for the question.
  272. LIST=""
  273. PROCESSED=""
  274. AVAIL_MODULES="$(find /lib/modules/$(uname -r)/ | sed 's!.*/!!' | cut -d . -f 1)"
  275. LOADED_MODULES="$(cut -d " " -f 1 /proc/modules) $(cut -d " " -f 1 /proc/modules | sed -e 's/_/-/g')"
  276. IFS_SAVE="$IFS"
  277. IFS="$NEWLINE"
  278. for device in $ALL_HW_INFO; do
  279.     module="${device%%:*}"
  280.     cardname="${device##*:}"
  281.     if [ "$module" != "ignore" -a "$module" != "" ] &&
  282.        ! in_list "$module" "$LOADED_MODULES" &&
  283.        ! in_list "$module" "$PROCESSED"
  284.     then
  285.         if [ -z "$cardname" ]; then
  286.             cardname="[Unknown]"
  287.         fi
  288.         
  289.         if in_list "$module" "$AVAIL_MODULES"; then
  290.             LIST="${LIST:+$LIST, }$module ($(echo "$cardname" | sed 's/,/ /g'))"
  291.             PROCESSED="$PROCESSED $module"
  292.         else
  293.             missing_module "$module" "$cardname"
  294.         fi
  295.     fi
  296. done
  297. IFS="$IFS_SAVE"
  298. db_progress STEP $OTHER_STEPSIZE
  299.  
  300. if [ "$LIST" ]; then
  301.     # Ask which modules to install.
  302.     db_subst hw-detect/select_modules list "$LIST"
  303.     db_set hw-detect/select_modules "$LIST"
  304.     db_input medium hw-detect/select_modules || true
  305.     db_go || exit 10 # back up
  306.     db_get hw-detect/select_modules
  307.     LIST="$RET"
  308. fi
  309.  
  310. list_to_lines() {
  311.     echo "$LIST" | sed 's/, /\n/g'
  312. }
  313.  
  314. # Work out amount to step per module load. expr rounds down, so 
  315. # it may not get quite to 100%, but will at least never exceed it.
  316. MODULE_STEPS=$(expr \( $MAX_STEPS - \( $OTHER_STEPS \* $OTHER_STEPSIZE \) \))
  317. if [ "$LIST" ]; then
  318.     MODULE_STEPSIZE=$(expr $MODULE_STEPS / $(list_to_lines | wc -l))
  319. fi
  320.  
  321. IFS="$NEWLINE"
  322.  
  323. for device in $(list_to_lines); do
  324.     module="${device%% *}"
  325.     cardname="`echo $device | cut -d'(' -f2 | sed 's/)$//'`"
  326.     # Restore IFS after extracting the fields.
  327.     IFS="$IFS_SAVE"
  328.  
  329.     if [ -z "$module" ] ; then module="[Unknown]" ; fi
  330.     if [ -z "$cardname" ] ; then cardname="[Unknown]" ; fi
  331.  
  332.     log "Detected module '$module' for '$cardname'"
  333.  
  334.     if is_not_loaded "$module"; then
  335.         db_subst hw-detect/load_progress_step CARDNAME "$cardname"
  336.         db_subst hw-detect/load_progress_step MODULE "$module"
  337.         db_progress INFO hw-detect/load_progress_step
  338.         if [ "$cardname" = "[Unknown]" ]; then
  339.             load_module "$module"
  340.         else
  341.             load_module "$module" "$cardname"
  342.         fi
  343.     fi
  344.  
  345.     db_progress STEP $MODULE_STEPSIZE
  346.     IFS="$NEWLINE"
  347. done
  348. IFS="$IFS_SAVE"
  349.  
  350. if [ -z "$LIST" ]; then
  351.     db_progress STEP $MODULE_STEPS
  352. fi
  353.  
  354. # Load ide-generic and check if that results in new block devices.
  355. # If so, make sure it is added to the initrd for the installed system.
  356. # Note: this may need to be done for more systems than just systems
  357. # that have an ISA bus, but that seems like a good start; it could also
  358. # be done unconditionally.
  359. if [ -z "$LOAD_IDE" ] && is_not_loaded ide-generic && \
  360.    [ -e /sys/bus/isa ] && is_available ide-generic; then
  361.     update-dev --settle
  362.     blockdev_count=$(ls /sys/block | wc -w)
  363.  
  364.     log "ISA bus detected; loading module 'ide-generic'"
  365.     load_module ide-generic
  366.     update-dev --settle
  367.     if [ $(ls /sys/block | wc -w) -gt $blockdev_count ]; then
  368.         log "New devices detected after loading ide-generic"
  369.  
  370.         # This will tell initramfs-tools to load ide-generic
  371.         kopts=
  372.         if db_get debian-installer/add-kernel-opts && [ "$RET" ]; then
  373.             kopts="$RET"
  374.         fi
  375.         if ! echo "$kopt" | grep -Eq "(^| )all_generic_ide( |$)"; then
  376.             db_set debian-installer/add-kernel-opts \
  377.                 "${kopts:+$kopts }all_generic_ide"
  378.         fi
  379.     fi
  380. fi
  381.  
  382. if ! is_not_loaded ohci1394 || ! is_not_loaded firewire-ohci; then
  383.     # if firewire was found, try to enable firewire cd support
  384.     if is_not_loaded sbp2 && is_not_loaded firewire-sbp2 && \
  385.         is_available scsi_mod; then
  386.             sbp2module=
  387.         if is_available firewire-sbp2; then
  388.             sbp2module=firewire-sbp2
  389.         elif is_available sbp2; then
  390.             sbp2module=sbp2
  391.         fi
  392.         if [ -n "$sbp2module" ]; then
  393.             db_subst hw-detect/load_progress_step CARDNAME "FireWire CDROM support"
  394.             db_subst hw-detect/load_progress_step MODULE "$sbp2module"
  395.             db_progress INFO hw-detect/load_progress_step
  396.             load_module "$sbp2module"
  397.             register-module "$sbp2module"
  398.         else
  399.             missing_module firewire-sbp2 "FireWire CDROM"
  400.         fi
  401.     fi
  402.     db_progress STEP $OTHER_STEPSIZE
  403. fi
  404.  
  405. # Always load the printer driver on i386 and amd64; it's hard to autodetect.
  406. case $SUBARCH in
  407.     i386/*|amd64/*)
  408.         register-module lp
  409.         ;;
  410. esac
  411.  
  412. apply_pcmcia_resource_opts() {
  413.     local config_opts=/etc/pcmcia/config.opts
  414.     
  415.     # Idempotency
  416.     if ! [ -f ${config_opts}.orig ]; then
  417.         cp $config_opts ${config_opts}.orig
  418.     fi
  419.     cp ${config_opts}.orig $config_opts
  420.  
  421.     local mode=""
  422.     local rmode=""
  423.     local type=""
  424.     local value=""
  425.     while [ -n "$1" ] && [ -n "$2" ] && [ -n "$3" ]; do
  426.         if [ "$1" = exclude ]; then
  427.             mode=exclude
  428.             rmode=include
  429.             shift
  430.         elif [ "$1" = include ]; then
  431.             mode=include
  432.             rmode=exclude
  433.             shift
  434.         fi
  435.         type="$1"
  436.         shift
  437.         value="$1"
  438.         shift
  439.         
  440.         if grep -q "^$rmode $type $value\$" $config_opts; then
  441.             sed "s/^$rmode $type $value\$/$mode $type $value/" \
  442.                 $config_opts >${config_opts}.new
  443.             mv ${config_opts}.new $config_opts
  444.         else
  445.             echo "$mode $type $value" >>$config_opts
  446.         fi
  447.     done
  448. }
  449.  
  450. # get pcmcia running if possible
  451. PCMCIA_INIT=
  452. if [ -x /etc/init.d/pcmciautils ]; then
  453.     PCMCIA_INIT=/etc/init.d/pcmciautils
  454. fi
  455. if [ "$PCMCIA_INIT" ]; then
  456.     if is_not_loaded pcmcia_core; then
  457.         db_input medium hw-detect/start_pcmcia || true
  458.  
  459.         # GTK frontend: include question about resources in dialog
  460.         if [ "$DEBIAN_FRONTEND" = "gtk" ]; then
  461.             db_input low hw-detect/pcmcia_resources || true
  462.         fi
  463.         db_go || true
  464.  
  465.         # Other frontends: only ask about resources if PCMCIA was selected
  466.         if [ "$DEBIAN_FRONTEND" != "gtk" ]; then
  467.             db_get hw-detect/start_pcmcia || true
  468.             if [ "$RET" = true ]; then
  469.                 db_input low hw-detect/pcmcia_resources || true
  470.                 db_go || true
  471.             fi
  472.         fi
  473.         if db_get hw-detect/pcmcia_resources && [ "$RET" ]; then
  474.             apply_pcmcia_resource_opts $RET
  475.         fi
  476.     fi
  477.     if db_get hw-detect/start_pcmcia && [ "$RET" = true ]; then
  478.         db_progress INFO hw-detect/pcmcia_step
  479.         $PCMCIA_INIT start 2>&1 | log
  480.         db_progress STEP $OTHER_STEPSIZE
  481.     fi
  482. fi
  483.  
  484. have_pcmcia=0
  485. if ls /sys/class/pcmcia_socket/* >/dev/null 2>&1; then
  486.     if db_get hw-detect/start_pcmcia && [ "$RET" = false ]; then
  487.         have_pcmcia=0
  488.     else
  489.         have_pcmcia=1
  490.     fi
  491. fi
  492.  
  493. # find Cardbus network cards
  494. cardbus_check_netdev()
  495. {
  496.     local socket="$1"
  497.     local netdev="$2"
  498.     if [ -L $netdev/device ] && \
  499.         [ -d $socket/device/$(basename $(readlink $netdev/device)) ]; then
  500.         echo $(basename $netdev) >> /etc/network/devhotplug
  501.     fi
  502. }
  503. if ls /sys/class/pcmcia_socket/* >/dev/null 2>&1; then
  504.     for socket in /sys/class/pcmcia_socket/*; do
  505.         for netdev in /sys/class/net/*; do
  506.             cardbus_check_netdev $socket $netdev
  507.         done
  508.     done
  509. fi
  510.  
  511. # Try to do this only once..
  512. if [ "$have_pcmcia" -eq 1 ] && \
  513.    ! grep -q pcmciautils /var/lib/apt-install/queue 2>/dev/null; then
  514.     log "Detected PCMCIA, installing pcmciautils."
  515.     apt-install pcmciautils || true
  516.  
  517.     if db_get hw-detect/pcmcia_resources && [ -n "$RET" ]; then
  518.         echo "mkdir /target/etc/pcmcia 2>/dev/null || true" \
  519.             >>$finish_install
  520.         echo "cp /etc/pcmcia/config.opts /target/etc/pcmcia/config.opts" \
  521.             >>$finish_install
  522.     fi
  523. fi
  524.  
  525. # Install udev into target
  526. apt-install udev || true
  527.  
  528. # TODO: should this really be conditional on hotplug support?
  529. if [ -f /proc/sys/kernel/hotplug ]; then
  530.     apt-install usbutils || true
  531. fi
  532.  
  533. # Install acpi
  534. if [ -d /proc/acpi ]; then
  535.     apt-install acpi || true
  536.     apt-install acpid || true
  537.     apt-install acpi-support-base || true
  538. fi
  539.  
  540. # If hardware has support for pmu, install pbbuttonsd
  541. if [ -d /sys/class/misc/pmu/ ]; then
  542.     apt-install pbbuttonsd || true
  543. fi
  544.  
  545. # Install mouseemu on systems likely to have single-button mice
  546. case $SUBARCH in
  547.     i386/mac|amd64/mac)
  548.         apt-install mouseemu || true
  549.     ;;
  550.     powerpc/powermac_*)
  551.         # mouseemu causes an oops somewhere in the input layer on
  552.         # powerpc64 at the moment, so don't install it.
  553.         if [ ! -d /proc/ppc64 ]; then
  554.             apt-install mouseemu || true
  555.         fi
  556.     ;;
  557. esac
  558.  
  559. # Install eject?
  560. if [ -n "$(list-devices cd; list-devices maybe-usb-floppy)" ]; then
  561.     apt-install eject || true
  562. fi
  563.  
  564. # Install optimised libc based on CPU type
  565. case "$(udpkg --print-architecture)" in
  566.     armel)
  567.     if grep -qw '^Features.* vfp' /proc/cpuinfo; then
  568.         apt-install libc6-vfp || true
  569.     fi
  570.     ;;
  571.     i386)
  572.     case "$(grep '^cpu family' /proc/cpuinfo | head -n1 | cut -d: -f2)" in
  573.         " 6"|" 15")
  574.         # intel 686 or Amd k6.
  575.         apt-install libc6-i686 || true
  576.                 ;;
  577.     esac
  578.     ;;
  579.     sparc)
  580.     if grep -q '^type.*: sun4u' /proc/cpuinfo ; then
  581.         # sparc v9 or v9b
  582.         if grep -q '^cpu.*: .*UltraSparc III' /proc/cpuinfo; then
  583.             apt-install libc6-sparcv9b || true
  584.         else
  585.             apt-install libc6-sparcv9 || true
  586.         fi
  587.     fi
  588.     ;;
  589. esac
  590.  
  591. # Install PS3 utilities
  592. case $SUBARCH in
  593.     powerpc/ps3)
  594.         apt-install ps3pf-utils || true
  595.         ;;
  596. esac
  597.  
  598. # Install Cell utilities
  599. case $SUBARCH in
  600.     powerpc/ps3|powerpc/cell)
  601.         apt-install elfspe2 || true
  602.         ;;
  603. esac
  604.  
  605. # Some hardware may need extra time to initialize:
  606.  
  607. # megaraid_mbox hardware RAID
  608. if lsmod | grep -q megaraid_mbox; then
  609.     db_progress INFO hw-detect/hardware_init_step
  610.     wait_megaraid_complete
  611.  
  612.     # Add rootdelay boot option for target system
  613.     if [ -z "$LOAD_IDE" ]; then
  614.         kopts=
  615.         if db_get debian-installer/add-kernel-opts && [ "$RET" ]; then
  616.             kopts="$RET"
  617.             # remove any existing rootdelay= option
  618.             kopts="$(echo "$kopts" | sed -r "s/(^| )rootdelay=[^ ]*//")"
  619.         fi
  620.         db_set debian-installer/add-kernel-opts \
  621.             "${kopts:+$kopts }rootdelay=10"
  622.     fi
  623. fi
  624. db_progress STEP $OTHER_STEPSIZE
  625.  
  626.  
  627. db_progress SET $MAX_STEPS
  628. db_progress STOP
  629.  
  630. if [ -n "$MISSING_MODULES_LIST" ]; then
  631.     log "Missing modules '$MISSING_MODULES_LIST"
  632. fi
  633.  
  634. check-missing-firmware
  635.  
  636. sysfs-update-devnames
  637.  
  638. # Let userspace /dev tools rescan the devices
  639. update-dev --settle
  640.  
  641. exit 0
  642.